<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Bootstrap 101 Template</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="/asset/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="/asset/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
<script src="http://code.jquery.com/jquery.js"></script>
<script src="/asset/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$('.dropdown-toggle').dropdown();
	});
//]]>
</script>
</head>
<body>
	<div class="container">
		<h1></h1>
		<div class="row">
			<div class="span12">
				
				<div class="navbar">
					<div class="navbar-inner">
						<ul class="nav"  role="navigation">
							<?php
							//Get the XML document loaded into a variable
							
							$xml = file_get_contents('./application/views/content/menu.xml');
							//Set up the parser object
							$parser = new XMLParser($xml);
				
							//Work the magic...
							$parser->Parse();
							$_topIndex = 0;
							$_leftIndex =0; 	
							
							foreach($parser->document->menu as $menu){
								//echo "<li><a href=\"".$menu->hyperlink[0]->tagData."\">{$menu->menuname[0]->tagData}</a></li>\n";
								echo "<li class=\"dropdown\"><a href=\"#\" id=\"drop{$_topIndex}\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">{$menu->menuname[0]->tagData}<b class=\"caret\"></b></a>\n";		
								if(@sizeof($parser->document->menu[$_topIndex]->menuitem) > 0){
									echo "	<ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"drop{$_topIndex}\">\n";
									foreach($parser->document->menu[$_topIndex]->menuitem as $left) {	
										echo "	<li role=\"presentation\"><li><a role=\"menuitem\" tabindex=\"-1\" href=\"{$left->hyperlink[0]->tagData}\">{$left->menuitemname[0]->tagData}</a></li>\n";
									}
									echo "	</ul>\n";
								}
								echo "</li>\n";
								$_topIndex++;	
							}
							?>
						</ul>
					</div>
				</div>
				
				
				<!-- <div class="alert alert-success">
					<div class="dropdown">
						<a class="dropdown-toggle" data-toggle="dropdown" href="#">Dropdown trigger</a>
						<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
							<li>1</li>
							<li>2</li>
						</ul>
					</div>
				<ul>
					
			
				</ul>
				</div> -->
			</div>
			<div class="span12">
				<div class="hero-unit">
				<?php 
					$this->load->view($_content);
				?>
				</div>
			</div>
		</div>
	</div>
	
</body>
</html>